import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
//测试路由
import GoodList from '@/views/GoodList'
import Title from './../views/Title.vue'
import Image from './../views/Image.vue'
import Cart from '@/views/Cart.vue'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld,
    // },
    // {
    //   path: '/goods/:goodsId/user/:name',
    //   name: 'GoodList',
    //   component: GoodList,
    // },
    // {
    //   path: '/goods',
    //   name: 'GoodList',
    //   component: GoodList,
    //   children:[
    //     {
    //       path: 'title',
    //       name: 'title',
    //       component: Title,
    //     },
    //     {
    //       path: 'img',
    //       name: 'img',
    //       component: Image,
    //     },
    //   ]
    // },
    {
      path: '/',
      name: 'GoodsList',
      components: {
        default:GoodList,
        title:Title,
        img:Image,
      },
    },
    {
      path: '/cart/:cartId',
      name: 'cart',
      component: Cart
    }
  ],
})
